home *** CD-ROM | disk | FTP | other *** search
/ Aminet 30 / Aminet 30 (1999)(Schatztruhe)[!][Apr 1999].iso / Aminet / dev / mui / bcc_src.lha / Parser / test / MyWindow_new.c < prev    next >
Encoding:
C/C++ Source or Header  |  1997-05-11  |  2.3 KB  |  134 lines

  1. /* ---------------------------------------------- */
  2. /* BCC header. Inserted into every generated file */
  3. /* ---------------------------------------------- */
  4.  
  5. #ifndef _BCC_EVERY
  6. #define _BCC_EVERY
  7.  
  8. /* Includes necessary for every mui c code */
  9.  
  10. #include <proto/exec.h>
  11. #include <proto/muimaster.h>
  12. #include <libraries/mui.h>
  13.  
  14. #include <mui/muiextra.h>
  15.  
  16. #include <string.h>
  17.  
  18. /* defines that help adjusting to any compiler */
  19.  
  20. #ifdef _DCC
  21.     #define REG(x) __ ## x
  22.     #define ASM
  23.     #define SAVEDS __geta4
  24. #else
  25.     #define REG(x) register __ ## x
  26.  
  27.     #ifdef _STORM
  28.  
  29.             #define ASM
  30.             #define SAVEDS __saveds
  31.  
  32.     #else
  33.  
  34.         #if defined __MAXON__ || defined __GNUC__
  35.             #define ASM
  36.             #define SAVEDS
  37.         #else
  38.             #define ASM    __asm
  39.             #define SAVEDS __saveds
  40.         #endif
  41.     
  42.     #endif
  43.  
  44. #endif
  45.  
  46. #define CallSuper() DoSuperMethodA(cl, obj, msg)
  47. #define value (tag->ti_Data)
  48. #define GetData() INST_DATA(cl, obj)
  49.  
  50. #endif
  51. #include "MyWindow.h"
  52.  
  53.  
  54. #include "initcl.h"
  55.  
  56. #ifndef MAKE_ID
  57. #define MAKE_ID(a,b,c,d) ((ULONG) (a)<<24 | (ULONG) (b)<<16 | (ULONG) (c)<<8 | (ULONG) (d))
  58. #endif
  59.  
  60.  
  61. unsigned long mMyWindowOM_NEW( struct IClass *cl, Object *obj, struct opSet* msg )
  62. {
  63.  unsigned long _ret = 0;
  64.  MyWindowData *data, _tdata;
  65.  data = &_tdata;
  66.  obj = (Object*)DoSuperNew( cl, obj,
  67.  
  68.             MUIA_Window_Title, (ULONG)"Koch: Project",
  69.             MUIA_Window_ID, MAKE_ID('K', 'P', 'R', 'J'),
  70.             WindowContents, GroupObject,
  71.                 MUIA_Background, MUII_WindowBack,
  72.                 Child, StringObject,
  73.                 End,
  74.                 Child, data->myobj = NewObject( cl_MyClass->mcc_Class, NULL,
  75.                 End,
  76.             End
  77.  
  78. ,
  79.  TAG_MORE, (unsigned long)msg->ops_AttrList,
  80.  TAG_DONE );
  81.  if( !obj ) return 0;
  82.  data = INST_DATA( cl, obj );
  83.  memcpy( data, &_tdata, sizeof( MyWindowData ) );
  84.  /* UC Beg */
  85.  
  86.  
  87.  /* UC End */
  88.  
  89.  _ret = (unsigned long)obj;
  90. OM_NEW_exit:
  91. return _ret;
  92. }
  93.  
  94.  unsigned long mMyWindowWinMet( struct IClass *cl, Object *obj, Msg msg )
  95. {
  96.  /* UC Beg */
  97.  
  98. /*    short a;
  99.     a = 10;
  100. */
  101.  MyWindowData *data = INST_DATA( cl, obj );
  102.  
  103.  if( data->myobj ) DisplayBeep( NULL );
  104.  
  105.  return 0;
  106.  
  107.  
  108.  /* UC End */
  109. }
  110.  
  111. void aMyWindowCustomAttrSet( struct IClass *cl, Object *obj, unsigned long val )
  112. {
  113.  MyWindowData *data = INST_DATA( cl, obj );
  114.  /* UC Beg */
  115.  
  116.  
  117.     DisplayBeep( val );
  118.  
  119.  
  120.  /* UC End */
  121. }
  122.  
  123. void aMyWindowCustomAttrGet( struct IClass *cl, Object *obj, unsigned long *store )
  124. {
  125.  MyWindowData *data = INST_DATA( cl, obj );
  126.  /* UC Beg */
  127.  
  128.  
  129.     *store = 2;
  130.  
  131.  
  132.  /* UC End */
  133. }
  134.